for num in range(100,1000):
    temp = num
    sum = 0
    while temp:
        digit = temp%10
        sum += digit ** 3
        temp //= 10
    if num==sum:
        print(num)